#region Summary 

// 
// Owner : JackieHan 
// 
// Solution : LearnSolution 
// 
// Project : JackieHan.ArithmeticCollect 
// 
// File : InfiniteSeries.cs 
// 
// CopyRight : Copyright © 2009-2010 XunGu Corporation, All Rights Reserved 
// 
// Summary : 无穷级数 1，2，4，8，16........
// 
// History : 
//			2010-05-22 17:43:07	    Create 
// 

#endregion

#region Using 

using System;
using System.Collections.Generic;

#endregion

namespace JackieHan.ArithmeticCollect
{
    /// <summary> 
    /// 无穷级数 
    /// </summary> 
    public class InfiniteSeries
    {
        /// <summary>
        /// 给定任意int值，找初无穷级数使这个数相加等给定数
        /// </summary>
        /// <param name="number">给定数值</param>
        public static void SearchNumbers(uint number)
        {
            uint bit = 1;
            Console.WriteLine(number);

            for(int i=0;i<32;i++)
            {
                if((number&bit)!=0)
                {
                    Console.WriteLine(Math.Pow(2, i));
                }
                bit <<= 1;
            }
        }
    }
}
